﻿using GylCSharpUtils.Common.Abstract;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GylCSharpUtils.P2PIPC.Client {
    public abstract class AIPCClient {

        public ASerializer Serializer { get; private set; }


        public void SetSerializer(ASerializer serializer) {
            Serializer = serializer;
        }

        /// <summary>
        /// 通过客户端发送消息
        /// </summary>
        /// <param name="msg">发送的消息</param>
        /// <returns>是否成功</returns>
        public abstract bool Send(object msg);

        /// <summary>
        /// 通过客户端接收消息
        /// </summary>
        /// <returns>获取的消息</returns>
        public abstract T Receive<T>();


        public abstract bool CanSend();

        public abstract bool CanReceive();


        public abstract bool Alive();
        
    }
}
